package com.wondertek.poms.sync.controller;

import java.util.HashMap;
import java.util.Map;
import javax.annotation.Resource;

import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class TaskController {

	@Resource
	private ThreadPoolTaskExecutor threadPoolA;
	
	@GetMapping("/threadPoolA/info")
	public Map<String, Object> num() {
		Map<String, Object> map = new HashMap<String, Object>();
		
		map.put("data", "池队列:" + threadPoolA.getThreadPoolExecutor().getQueue().size() + 
				"|池任务数:" + threadPoolA.getThreadPoolExecutor().getTaskCount() + 
				"|池活跃线程数:" + threadPoolA.getThreadPoolExecutor().getActiveCount()); 
		
		return map;
	}
}
